-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POC Pipeline resource interface #442
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: shashwathi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
467825f
to
debeb3f
Compare
/hold |
I think the resource interface should be a part of a bigger design proposal covering for example the discoverability of external resource types running on the cluster, I suggest a design doc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great PR, some minor comments
@@ -19,6 +19,8 @@ package v1alpha1 | |||
import ( | |||
"fmt" | |||
"strings" | |||
|
|||
corev1 "k8s.io/api/core/v1" | |||
) | |||
|
|||
// NewImageResource creates a new ImageResource from a PipelineResource. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be an opportunity to remove the Image resource till its properly implemented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a private chat with @bobcatfish about this. I am rephrasing @bobcatfish point here. There is value is keeping image resource because tasks can use its attributes. For eg: in templating params.
@@ -30,7 +42,8 @@ type GitResource struct { | |||
// Git revision (branch, tag, commit SHA or ref) to clone. See | |||
// https://git-scm.com/docs/gitrevisions#_specifying_revisions for more | |||
// information. | |||
Revision string `json:"revision"` | |||
Revision string `json:"revision"` | |||
TargetPath string | |||
} | |||
|
|||
// NewGitResource create a new git resource to pass to Knative Build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to support upload for git?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that would be awesome. I don't know if I want to do that feature in this PR.
/hold cancel |
I like where this is going!! @shashwathi this seems like it plays nicely into #238, if you are interested in writing up a design doc plz feel free to :D But I think that this change can probably go in beforehand, since it's just internal and we can keep iterating on it :D |
@@ -52,6 +53,9 @@ type PipelineResourceInterface interface { | |||
GetType() PipelineResourceType | |||
GetParams() []Param | |||
Replacements() map[string]string | |||
GetDownloadContainerSpec() ([]corev1.Container, error) | |||
GetUploadContainerSpec() ([]corev1.Container, error) | |||
SetDestinationDirectory(string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like it!!
@bobcatfish : Yes the plan is to iterate and have solid resource interface. |
Try to unify different types of pipeline resource when processing input / output resources. As we add more resources the contract should be more simple. Removed git from build source and add the functionality similar to other resources. Resource defines list of container definitions to download and list of container definitions to upload as well.
debeb3f
to
dce7b2f
Compare
The following is the coverage report on pkg/.
|
cc @pivotal-nader-ziada @bobcatfish @tejal29 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM 👼 👍
great improvement to the interface 👍 /lgtm |
Accidentally in Pr tektoncd#442 I introduced the bug for processing image resource. Added test this time to catch this. Hopefully this should not surface again
Accidentally in Pr tektoncd#442 I introduced the bug for processing image resource. Added test this time to catch this. Hopefully this should not surface again
Accidentally in Pr #442 I introduced the bug for processing image resource. Added test this time to catch this. Hopefully this should not surface again
why: Trying to unify different types of pipeline resource when processing input/ output resources.
what:
and list of container definitions to upload as well.
Hopefully this should get us a step closer to having a better resource interface
cc @bobcatfish @pivotal-nader-ziada